<html>
<head><meta charset="utf-8"><title>Is aarch64 lit with Neon? · t-compiler/arm · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/index.html">t-compiler/arm</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html">Is aarch64 lit with Neon?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="211435020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211435020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211435020">(Sep 27 2020 at 21:19)</a>:</h4>
<p>Hi! We were wondering in #project-portable-simd if the aarch64 build triples are supposed to always include Neon SIMD support even if e.g. other armv8 triples do not? ARMv8 is specified to not necessarily <em>have to</em> include SIMD, but everything seems to suggest aarch64 itself does (or at least supports some subset) which is why I ask, e.g. <a href="https://developer.arm.com/documentation/den0024/a/aarch64-floating-point-and-neon">https://developer.arm.com/documentation/den0024/a/aarch64-floating-point-and-neon</a></p>
<blockquote>
<p>Both floating-point and NEON are required in all standard ARMv8 implementations. However, implementations targeting specialized markets may support the following combinations:</p>
</blockquote>
<p>I also understand it has an "aarch32" identity that is mostly like the armv7{a,t} architectures and can run code like they do, and I was wondering if it supports using the Neon SIMD units as 64-bit vectors in aarch64 mode, or only in aarch32 mode. The question in particular is really, "if I issue a 64-bit vector instruction to aarch64, will it accept that instruction, and if it does, will it execute a 64-bit vector operation where no activity occurs in the other 64 bits of the SIMD vector, or will it execute a 128-bit vector operation and try to pretend the other 64 bits didn't matter?" The latter behaviour Works, but is of slight concern because then the question is if those bits are allowed to e.g. set floating point flags, amongst other things.</p>



<a name="211439999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211439999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211439999">(Sep 27 2020 at 23:33)</a>:</h4>
<p>Technically speaking an ARMv8 CPU is <em>required</em> to support NEON.</p>



<a name="211440042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211440042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211440042">(Sep 27 2020 at 23:34)</a>:</h4>
<p>All armv8 triples should have the neon feature enabled.</p>



<a name="211440062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211440062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211440062">(Sep 27 2020 at 23:35)</a>:</h4>
<p>In some cases you may want to compile with FP/NEON disabled, e.g. in a kernel. But this is done with a custom target.</p>



<a name="211440124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211440124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211440124">(Sep 27 2020 at 23:36)</a>:</h4>
<p>If NEON is support you are guaranteed to have the full 128-bit registers and instructions available. There are separate instructions for 64-bit SIMD and 128-bit SIMD.</p>



<a name="211442293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211442293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211442293">(Sep 28 2020 at 00:32)</a>:</h4>
<p>Ah, I thought there were some Neon implementations for armv7 targets that only had 64-bit vector registers,<br>
and that ARMv8-M does not necessarily support Neon instructions?</p>



<a name="211442613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211442613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211442613">(Sep 28 2020 at 00:42)</a>:</h4>
<p>It says on page linked above that "floating-point and NEON are required in all standard ARMv8 implementations", but also "implementations targeting specialized markets may support the following combinations" one of which is "No NEON or floating-point".</p>



<a name="211442633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211442633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211442633">(Sep 28 2020 at 00:43)</a>:</h4>
<p>I'm less familiar with ARMv8-M, but that's a 32-bit only architecture.</p>



<a name="211442697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211442697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211442697">(Sep 28 2020 at 00:44)</a>:</h4>
<p>Well my point is that <em>standard</em> <code>ARMv8</code> has Neon, but not <em>all</em> <code>ARMv8</code> will have it.</p>
<p>Still, our target profiles should have it enabled and then people can make alternate target profiles for their exceptional CPUs that don't have it.</p>



<a name="211531532"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211531532" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211531532">(Sep 28 2020 at 18:35)</a>:</h4>
<p>I searched and confirmed that there's some background work for armv8r targets that do not have Neon as a feature.</p>



<a name="211536435"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211536435" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211536435">(Sep 28 2020 at 19:11)</a>:</h4>
<p>I'm going to run down the person who added that and chatter with them. armv8r shouuuld always be it's own target, but</p>



<a name="211547315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211547315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211547315">(Sep 28 2020 at 20:39)</a>:</h4>
<p>Why do you need to know this? Just check for the <code>neon</code> target feature.</p>



<a name="211552860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211552860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211552860">(Sep 28 2020 at 21:29)</a>:</h4>
<p>Well it's important to know because we need to write documentation about default features of targets down as part of writing the SIMD usage guide.</p>



<a name="211907057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211907057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Rodolph Perfetta <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211907057">(Oct 01 2020 at 13:13)</a>:</h4>
<p>armv8 covers many things, too many to be useful as a target discriminator on<br>
its own.</p>
<p>The Arm architecture has three profiles: A, R and M. The A profile targets<br>
phones, laptops, servers, anything where the OS needs an MMU. The R and M<br>
profiles target more embedded use cases from hard drives to sensors, usually<br>
using RTOSes. Each profile will have different target triples.</p>
<p>armv8-A: NEON is <em>required</em>. Often the A is omitted when referring to armv8-A<br>
armv8-R, NEON is optional.<br>
armv8-M, no NEON. The M-Profile is a bit particular, it doesn't have 64-bit<br>
support or even 32-bit arm, it only supports the Thumb instruction set. In the<br>
Rust compiler it is supported as thumbv8m* triples.</p>
<p>Recently the M-Profile gained optional support for vector extension (MVE), but<br>
MVE is different from NEON and is not available on other profiles.</p>
<p>HTH,<br>
Rodolph.</p>



<a name="211907732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/242906-t-compiler/arm/topic/Is%20aarch64%20lit%20with%20Neon%3F/near/211907732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/242906-t-compiler/arm/topic/Is.20aarch64.20lit.20with.20Neon.3F.html#211907732">(Oct 01 2020 at 13:18)</a>:</h4>
<p>It does, thank you!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>